<%@ page import="java.util.List" %>
<%@ page import="com.minxi.web.javabean.UserInfo" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2024-06-13
  Time: 10:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<style>
    table {
        border: 1px solid black;
    }
    table tr th{
        border: 1px solid black;
    }
    table tr td{
        border: 1px solid black;
    }
</style>
<body>
<%
    String contextPath=request.getContextPath();
    List<UserInfo> userList =(List<UserInfo>) request.getSession().getAttribute("userList");

%>
<h1>学生管理系统列表页</h1>
<div class="a_container">
    <a href="<%=contextPath%>/jsp/index.jsp" class="a_btu">返回主页</a>
</div>
<hr>
<a href="<%=contextPath%>/jsp/add.jsp" class="a_btu">新增用户</a>
<table>
<table>
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>性别</th>
        <th>手机号</th>
    </tr>
    <%for (UserInfo userInfo : userList){%>
        <tr>
        <td><%=userInfo.getId()%></td>
        <td><%=userInfo.getUserName()%></td>
        <td><%=userInfo.getUserAge()%></td>
        <%-- 三元运算符 1男 2女--%>
        <td><%=1 == userInfo.getUserSex() ? "男":"女"%></td>
        <td><%=userInfo.getUserPhone()%></td>
    </tr>
    <%}%>
}
</table>
</body>
</html>
